feat(core): opt out of the MCP auto-mount for Vite-plugin consumers - #559
Merged
Conversation
Hub 0.9.9 flipped the aggregate MCP route's default to 'auto', mounting a Streamable-HTTP endpoint at <base>__mcp as soon as any agent-flagged action exists. The Vite plugin built its initHub call from a fixed field list with no mcp slot, so consumers inherited the auto-mount with no supported way to turn it off. Expose mcp on DevToolsConfig and forward it into initHub, mirroring the allowedOrigins pass-through. Closes #557
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
@devframes/hub@0.9.9flipped the aggregate MCP route's default from off to'auto', mounting a Streamable-HTTP endpoint at<base>__mcpas soon as any agent-flagged action exists. The Vite plugin builds itsinitHub({...})call from a fixed field list that never includedmcp, and none ofDevToolsConfig/DevToolsPluginOptions/DevToolsOptionsexposed one — so a Vite-plugin consumer inherited the new auto-mount with no supported way to turn it off, even when MCP is already bridged elsewhere.This adds
mcp?: McpSettingtoDevToolsConfigand forwards it intoinitHub({...}), mirroring the existingallowedOriginspass-through. Omitting it preserves the hub's'auto'default;mcp: falsedisables the route,truemounts it unconditionally, and an object opts into an identity check.Linked Issues
fixes #557
Additional context
The value flows through
normalizeDevToolsConfiginto the resolved config and is read back increateDevToolsHub, so it covers both the Vite dev-server and standalone/CLI paths. Only forwarded when set, keeping the hub's own default intact.This PR was created with the help of an agent.